package com.hxd.otc.module.my.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.hxd.otc.R;
import com.hxd.otc.base.BaseAdapter;
import com.hxd.otc.common.enums.BankType;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by lzy on 2018/6/7 0007.
 * description ${选择银行卡类型}
 */
public class SelectBankTypeAdapter extends BaseAdapter<SelectBankTypeAdapter.SelectTradingModeHolder, BankType> {

    public SelectBankTypeAdapter(Context context) {
        super(context);
    }

    @Override
    protected void onBindHolder(@NonNull SelectTradingModeHolder holder, int position) {
        holder.tvCardType.setText(getItem(position).getBankName());
    }

    @NonNull
    @Override
    public SelectTradingModeHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new SelectTradingModeHolder(mInflater.inflate(R.layout.item_select_bank_type, parent, false));
    }

    static class SelectTradingModeHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.tv_card_type)
        TextView tvCardType;

        public SelectTradingModeHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }
}
